package com.cskaoyan.order.api;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.mall.commons.result.ServiceCallResponseUtil;
import com.cskaoyan.order.dal.entitys.Stock;
import com.cskaoyan.order.dal.persistence.StockMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : bunnyupup
 * @description :
 * @date : Created in 2022/8/25 19:56
 */
@RestController
public class CartApiImpl {
    @Autowired
    StockMapper stockMapper;

    @GetMapping(value = "/cart/stock")
    Stock getStock(@RequestParam("itemId") Long id){
        Stock stock = stockMapper.selectStock(id);
//        ServiceCallResponseUtil<Stock> responseUtil = new ServiceCallResponseUtil<>();
//        return responseUtil.ok(stock);
        return stock;
    }
}
